package org.redmagic.agent.location.file;

import org.redmagic.agent.location.DomLocationParser;
import org.redmagic.location.UriLocation;
import org.w3c.dom.Element;

public class CacheLocationParser implements DomLocationParser {

    public static final String DEFAULT_CACHE_NAME = "redmagic-cache.properties";

    @Override
    public UriLocation parse(Element locationElement) {
        String uri = locationElement.getAttribute("uri");
        return new CacheLocation((uri == null ? DEFAULT_CACHE_NAME : uri));
    }
}